import React, { Component } from 'react'
import { View, Icon, Button } from '@tarojs/components'
import Taro from '@tarojs/taro'
import './feedback.scss'

export default class feedback extends Component {


  goHome() {
    Taro.navigateTo({
      url: '/pages/index/index',
    })
  }

  republish() {
    this.props.republishEvent();
  }

  render() {

    let success = (
      <View className="feedback" >
        <Icon className="icon-box-img" type="success" size="93"></Icon>
        <Button onClick={()=>this.goHome()}>返回首页</Button>
      </View>
    )

    let fail = (
      <View className="feedback" >
        <Icon className="icon-box-img" type="warn" size="93"></Icon>
        <Button onClick={()=>this.republish()}>重新输入</Button>
      </View>
    )


    return (
      <>
        {
          this.props.issuccess ? success : fail
        }
      </>
    )
  }
}
